<template>
  <div class="flex align-items-center">
    <el-checkbox v-model="isGood">精华</el-checkbox>
    <el-select v-model="listType" class="m-l-16">
      <el-option value="all" label="全部" />
      <el-option value="open" label="打开" />
      <el-option value="solved" label="已解决" />
    </el-select>
  </div>
</template>

<script>
export default {
  name: 'list-filter',
  data() {
    return {
      isGood: false,
      listType: 'all',
    };
  },
  created() {
    this.isGood = !!this.$route.query.is_good;
    this.listType = this.$route.query.type || 'all';
  },
  watch: {
    isGood(val) { this.addQuery({ is_good: val || undefined, page: undefined }); },
    listType(val) { this.addQuery({ type: val, page: undefined }); },
  },
};
</script>

<style></style>
